<html>
<head><meta charset="utf-8"><title>Existing UB in safe code · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Existing.20UB.20in.20safe.20code.html">Existing UB in safe code</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="133780343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Existing%20UB%20in%20safe%20code/near/133780343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nicole Mazzuca <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Existing.20UB.20in.20safe.20code.html#133780343">(Sep 12 2018 at 06:10)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/54148" target="_blank" title="https://github.com/rust-lang/rust/issues/54148">https://github.com/rust-lang/rust/issues/54148</a></p>
<p>What's the best way to go about fixing this?</p>



<a name="133800698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Existing%20UB%20in%20safe%20code/near/133800698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> avadacatavra <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Existing.20UB.20in.20safe.20code.html#133800698">(Sep 12 2018 at 14:03)</a>:</h4>
<p>I've commented this in the #[repr(packed)] discussion</p>



<a name="134115153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Existing%20UB%20in%20safe%20code/near/134115153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Existing.20UB.20in.20safe.20code.html#134115153">(Sep 17 2018 at 17:36)</a>:</h4>
<p>(as also mentioned in the issue) This is not actually UB, it's just a lack of documentation for how the compiler avoids UB.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>